package cn.mesmile.design.composite;

/**
 * @author zb
 * @date 2020/11/16 23:42
 * @Description:
 */
public class File extends Root {

    public File(String name) {
        super(name);
    }

    @Override
    public void add(Root root) {

    }

    @Override
    public void removeFile(Root root) {

    }

    @Override
    public void display(int depth) {
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; i < depth ; i++) {
            stringBuffer.append("_");
        }
        // 打印横线和当前文件名
        System.out.println(stringBuffer.toString()+ this.getName());
    }
}
